package cn.wolfcode.trip.admin.controller;

import cn.wolfcode.trip.base.domain.SystemNotice;
import cn.wolfcode.trip.base.service.ISystemNoticeService;
import cn.wolfcode.trip.base.util.JSONUtil;
import cn.wolfcode.trip.base.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

/**
 * 系统公告
 */
@Controller
@RequestMapping("/systemNotice")
public class SystemNoticeController {

    @Autowired
    private ISystemNoticeService systemNoticeService;

    @RequestMapping("/input")
    public String input(){
        return "systemNotice/input";
    }

    //发布公告
    @RequestMapping("/save")
    @ResponseBody
    public Object save(SystemNotice entity){
        systemNoticeService.saveAll(entity);
        return new JsonResult();
    }
}
